@tailwind base;
@tailwind components;
@tailwind utilities;

/* 自定义CSS变量 */
:root {
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-warning: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --gradient-danger: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-medium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-large: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 深色模式变量 */
.dark {
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-warning: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --gradient-danger: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* 全局样式 */
* {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  @apply bg-gray-100 dark:bg-gray-800 rounded-full;
}

::-webkit-scrollbar-thumb {
  @apply bg-gray-300 dark:bg-gray-600 rounded-full hover:bg-gray-400 dark:hover:bg-gray-500;
}

/* 自定义组件类 */
.glass-card {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-card {
  background-color: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(55, 65, 81, 0.2);
}

.gradient-border {
  position: relative;
  background: linear-gradient(white, white) padding-box,
              var(--gradient-primary) border-box;
  border: 2px solid transparent;
}

.dark .gradient-border {
  background: linear-gradient(rgb(31 41 55), rgb(31 41 55)) padding-box,
              var(--gradient-primary) border-box;
}

/* 动画增强 */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.3); }
  50% { box-shadow: 0 0 30px rgba(102, 126, 234, 0.6); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* 状态指示器 */
.status-indicator {
  position: relative;
  display: inline-flex;
  height: 0.75rem;
  width: 0.75rem;
  border-radius: 9999px;
}

.status-indicator::after {
  position: absolute;
  display: inline-flex;
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  opacity: 0.75;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
  content: '';
}

.status-connected::after {
  background-color: #4ade80;
}

.status-connecting::after {
  background-color: #facc15;
}

.status-disconnected::after {
  background-color: #f87171;
}

/* 按钮增强 */
.btn-primary {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(to right, #3b82f6, #9333ea);
  color: white;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1);
  transition: all 0.2s;
  outline: none;
}

.btn-primary:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  padding: 0.75rem 1.5rem;
  background-color: white;
  color: #374151;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #d1d5db;
  transform: scale(1);
  transition: all 0.2s;
}

.dark .btn-secondary {
  background-color: #374151;
  color: #d1d5db;
  border-color: #4b5563;
}

.btn-secondary:hover {
  background-color: #f9fafb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.dark .btn-secondary:hover {
  background-color: #4b5563;
}

.btn-danger {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(to right, #ef4444, #ec4899);
  color: white;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1);
  transition: all 0.2s;
  outline: none;
}

.btn-danger:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.btn-danger:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
}

/* 输入框增强 */
.input-enhanced {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  outline: none;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.dark .input-enhanced {
  background-color: rgba(55, 65, 81, 0.8);
  border-color: #4b5563;
}

.input-enhanced:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
}

.dark .input-enhanced:focus {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.8);
  border-color: #60a5fa;
}

.input-error {
  border-color: #ef4444;
}

.input-error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

.dark .input-error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.8);
}

/* 卡片增强 */
.card-enhanced {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transition: all 0.3s;
  transform: scale(1);
}

.dark .card-enhanced {
  background-color: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(55, 65, 81, 0.2);
}

.card-enhanced:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  transform: scale(1.02);
}

/* 通知样式 */
.notification-enter {
  transform: translateX(100%);
  opacity: 0;
}

.notification-enter-active {
  transform: translateX(0);
  opacity: 1;
  transition: all 0.3s;
}

.notification-exit {
  transform: translateX(0);
  opacity: 1;
}

.notification-exit-active {
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s;
}
